package com.ld.campus_help.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ld.campus_help.entity.Lost;
import com.ld.campus_help.entity.School;
import com.ld.campus_help.service.LostService;
import com.ld.campus_help.mapper.LostMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 10937
* @description 针对表【lost】的数据库操作Service实现
* @createDate 2023-08-24 19:57:13
*/
@Service
public class LostServiceImpl extends ServiceImpl<LostMapper, Lost>
    implements LostService{

    @Autowired
    private LostMapper lostMapper;

    @Override
    public List<Lost> getList() {
        QueryWrapper<Lost> queryWrapper = new QueryWrapper<>();
        return lostMapper.selectList(queryWrapper);
    }

    @Override
    public List<Lost> getList(Lost lost) {
        QueryWrapper<Lost> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("school_id", lost.getSchoolId());
        queryWrapper.eq("status", lost.getStatus());
        return lostMapper.selectList(queryWrapper);
    }
}




